package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.Collection;
import com.antdesignbackend.backend.entity.entityVo.CollectionVo;
import com.antdesignbackend.backend.mapper.CollectionMapper;
import com.antdesignbackend.backend.service.CollectionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collection> implements CollectionService {
    @Autowired
    CollectionMapper collectionMapper;

    @Override
    public List<CollectionVo> search(QueryWrapper<CollectionVo> queryWrapper, Page<CollectionVo> page) {
        return collectionMapper.search(queryWrapper, page);
    }

    @Override
    public Integer count(QueryWrapper<CollectionVo> queryWrapper) {
        return collectionMapper.count(queryWrapper);
    }

    @Override
    public List<CollectionVo> sum(@Param(Constants.WRAPPER) QueryWrapper<CollectionVo> queryWrapper,
                                  Page<CollectionVo> page) {
        return collectionMapper.sum(queryWrapper, page);
    }

    @Override
    public Integer sumCount(@Param(Constants.WRAPPER) QueryWrapper<CollectionVo> queryWrapper) {
        return collectionMapper.sumCount(queryWrapper);
    }

    ;

    @Override
    public Integer count2(@Param(Constants.WRAPPER) QueryWrapper<CollectionVo> queryWrapper) {
        return collectionMapper.count2(queryWrapper);
    }

    ;

    @Override
    public List<CollectionVo> search2(@Param(Constants.WRAPPER) QueryWrapper<CollectionVo> queryWrapper,
                                      Page<CollectionVo> page) {
        return collectionMapper.search2(queryWrapper, page);
    }

    ;

}
